CC = g++
FUSEFLAGS = -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26
LINKFLAGS = -lsqlite3 -lfuse
CFLAGS = -Wall -c $(FUSEFLAGS)
LDFLAGS = -Wall $(FUSEFLAGS) $(LINKFLAGS)
OBJECTS = FSObject.o Database.o FileSystem.o Tag.o File.o fuse.o DirInit.o DirWalker.o support.o
ALL = tagfs

all: $(ALL)

$(ALL) : % : %.c $(OBJECTS)
	$(CC) -o $@ $(LDFLAGS) $^

%.o : %.c
	$(CC) -o $@ $(CFLAGS) $<

%.o : %.cpp
	$(CC) -o $@ $(CFLAGS) $<

clean:
	rm -f *.o $(ALL) *~
